<template>
  <div style="width: 500px">
    <Carousel autoplay v-model="value" loop style="" radius-dot="false">
      <CarouselItem v-for="idx in  carousels " :key="idx.id">
        <div class="demo-carousel" style="width: 100%;text-align:center">
            <img :src="idx.url">
            <span style="font-size: 26px; ">{{idx.title}}</span>
        </div>
      </CarouselItem>
    </Carousel>
  </div>
</template>

<script>
export default {
  created() {
    this.$axios
      .get(" http://unicloud.codecore.cn/admin/bannerList?page=0&limit=10")
      .then((res) => {
        for(let i=0;i<res.data.data.length;i++){
            this.carousels[i] = res.data.data[i]

        }
      });
  },
  data() {
    return {
      value: 0,
      carousels: [],
    };
  },
};
</script>
<style>
.demo-carousel img{
    margin :0 auto;
    width: 100%;
}
</style>